package com.rd.student.dashuju.sunwenzhuo.day0731;

import java.util.Arrays;

public class Test6 {
    public static void main(String[] args) {
        int[] arr = new int[20];
        for (int i = 0; i < 20; i++) {
            arr[i] = -1;
        }
        for (int i = 0; i < 20; i++) {
            int random = (int) (Math.random() * 50);
            if (arr[i] == -1) {
                arr[i] = random;
            } else {
                i--;
            }
        }
        System.out.println(Arrays.toString(arr));
    }
}
